<template>
  <div class="home">
    <img @click="handeClick" alt="Vue logo" src="../assets/logo.png" />
    <HelloWorld msg="Welcome to Your Vue.js App" />
    {{ msg }}
  </div>
</template>

<script>
// @ is an alias to /src
import HelloWorld from '@/components/HelloWorld.vue'
import { mapMutations, mapState } from 'vuex'
export default {
  name: 'HomeView',
  // data() {
  //   return {
  //     homeMsg: '我是home-msg',
  //   }
  // },
  computed: {
    ...mapState(['msg']),
  },
  methods: {
    ...mapMutations(['set_msg']),
    handeClick() {
      this.set_msg('我是传入的msg-------->>')
    },
  },
  components: {
    HelloWorld,
  },
}
</script>
